Added api and refactoring urls