Cleaner api calls

Exceptions and HTTP request now work better. Code is more readable.