finalized api outputs, http error handling