Make some changes, return errors from API properly