added ajax calls to api