I came across a article discussing about security with JavaScript.
Some of the solutions for this are:
1. Use a Secret in the Request
2. Force pre-eval() Processing
3. Force POST requests
A good explaination can be found in:How to Protect a JSON or Javascript Service