changes on api flow and migration scripts