[#17] added api middleware, generic routes actions and api helper