Mail API fixes

- The mail API endpoints weren't quite working correctly. Now working but still need love