Added some comments and cleaned up a bit
Added status codes to API responses