Committed code for auth framework and send response in JSON format