building api controller