Refactor code to support responses and provide proper notification based on response status
Define response status for ajax callback function