fixed api encode object to allow values to be 0
added tests for http methods in api