Improve apis and controllers