Mayor fixes and Improvements in the api

Frontend will follow