Adding subrouter for api. Also added more work on api