Handling Angular and Ajax requests