Add form request (application/x-www-form-urlencoded) support for sparql end point
- Refactor the rest api codes for sparql

Resolves: https://www.pivotaltracker.com/story/show/72619228