Feature/api

We should use query builder here to make code cleaner