Fixed a bug in API, changed routes structure.