create API routes + functional tests