API test + misc fixes

#171 
Minor changes to the unit tests in API. There is nothing much to test since the API are just facades... (CMIIW)
There are some misc changes here as well