mysql3 to postgresql migrated.
api and cors fixes