Set routes constraints for the api
Add tests for api constraints