Added some flexibility do api controller