Changes returned status code to the couchdb status
Adds some first test cases