Fixed JSON parser

Fixed JSON parser afte the test failed.
Method to create a valid URL

Implemented a method in the factory to generate valid URLs for the API
method calls. Including more unit tests. Wrote more comments.