grape api refactored slightly