created api module with authentication middleware