def prefix_handlers(endpoint, handlers):
    """Prepends each handlers route with the given endpoint.

    eg.

    Given:
        endpoint    = /sweet+service/1.0
        handlers[0] = (r"/people, PeopleHandler)
    ------
    Result:
        handlers[0] = (r"/sweet+service/1.0/people", PeopleHandler)
    """
    if not endpoint:
        endpoint = '/'
    for i, handler in enumerate(handlers):
        path = handler[0]
        if path[0] == '/':
            path = path[1:]
        handlers[i] = (endpoint+path,)+handler[1:]
    return handlers