Fixing tests, better error handling

Also some of the APIs don't return an error message, they will just give a status code