Refactored the query logic into a seperate http query function
example test for buckets
fixes to syntax
added some clearer instructions on how the API looks