API fixes

All API methods except delete are working, but lacks validation and
error management.